package com.tang.common.entity.community;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 
 * </p>
 *
 * @author 唐朝阳
 * @since 2022-05-17
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class Comment implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 评论id
     */
    @TableId(value = "comment_id", type = IdType.AUTO)
    private Integer commentId;

    /**
     * 评论用户id
     */
    private String userName;
    private String avatar;

    /**
     * 文章id
     */
    private Integer articleId;
    private String articleTitle;

    /**
     * 父评论
     */
    private Integer parentId;
    @TableField(exist = false)
    private Comment comment;

    /**
     * 评论内容
     */
    private String commentContent;

    @TableField(exist = false)
    private List<Comment> childCommentList;

    /**
     * 删除标志，1为存在，0为删除
     */
    private Integer deleteFlag;

    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd")
    private Date createTime;
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

}
